package com.baiyue.entity;

import com.baomidou.mybatisplus.enums.IdType;
import java.util.Date;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableName;
import java.io.Serializable;

import com.baomidou.mybatisplus.annotations.Version;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.*;
import lombok.experimental.Accessors;
import org.springframework.validation.annotation.Validated;

/**
 *
 * @author 伍波
 * @date 2024-06-16
 */
@Data
@TableName("product_category")
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Validated
public class ProductCategory implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 分类ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    /**
     * 分类名称
     */
    @TableField("category_name")
    private String categoryName;
    /**
     * 创建时间
     */
    @TableField("create_time")
    private Date createTime;
    /**
     * 创建人
     */
    @TableField("created_by")
    private String createdBy;
    /**
     * 更新时间
     */
    @TableField("update_time")
    private Date updateTime;
    /**
     * 更新人
     */
    @TableField("updated_by")
    private String updatedBy;
    /**
     * 状态（0-正常，1-删除）
     */
    private Integer status;

    /**
     * 开始时间
     */
    @TableField(exist = false)
    private String start;

    /**
     * 结束时间
     */
    @TableField(exist = false)
    private String end;

    /**
     * 排序字段
     */
    @TableField(exist = false)
    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
    private String sortField;

    /**
     * 排序顺序
     * desc  asc
     */
    @TableField(exist = false)
    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
    private String sortValue;

    public ProductCategory(String categoryName, Date createTime, String createdBy, Date updateTime, String updatedBy,
                           Integer status, String start, String end, String sortField, String sortValue) {
        this.categoryName = categoryName;
        this.createTime = createTime;
        this.createdBy = createdBy;
        this.updateTime = updateTime;
        this.updatedBy = updatedBy;
        this.status = status;
        this.start = start;
        this.end = end;
        this.sortField = sortField;
        this.sortValue = sortValue;
    }
}
